
<h1><span class="yiyi-st" id="yiyi-12">numpy.pv</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.pv.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.pv.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="function">
<dt id="numpy.pv"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.</code><code class="descname">pv</code><span class="sig-paren">(</span><em>rate</em>, <em>nper</em>, <em>pmt</em>, <em>fv=0.0</em>, <em>when=&apos;end&apos;</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/numpy/numpy/blob/v1.11.3/numpy/lib/financial.py#L418-L510"><span class="viewcode-link">[source]</span></a></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">计算当前值。</span></p>
<dl class="docutils">
<dt><span class="yiyi-st" id="yiyi-15">给定：</span></dt>
<dd><ul class="first last simple">
<li><span class="yiyi-st" id="yiyi-16">未来值<a class="reference internal" href="numpy.fv.html#numpy.fv" title="numpy.fv"><code class="xref py py-obj docutils literal"><span class="pre">fv</span></code></a></span></li>
<li><span class="yiyi-st" id="yiyi-17">每个期间复利一次利息<a class="reference internal" href="numpy.rate.html#numpy.rate" title="numpy.rate"><code class="xref py py-obj docutils literal"><span class="pre">rate</span></code></a>，其中有</span></li>
<li><span class="yiyi-st" id="yiyi-18"><a class="reference internal" href="numpy.nper.html#numpy.nper" title="numpy.nper"><code class="xref py py-obj docutils literal"><span class="pre">nper</span></code></a>总计</span></li>
<li><span class="yiyi-st" id="yiyi-19">（固定）付款，<a class="reference internal" href="numpy.pmt.html#numpy.pmt" title="numpy.pmt"><code class="xref py py-obj docutils literal"><span class="pre">pmt</span></code></a>，付款</span></li>
<li><span class="yiyi-st" id="yiyi-20">每个周期开始时（<em class="xref py py-obj">时</em> = {&apos;begin&apos;，1}）或结束（<em class="xref py py-obj">时</em> = {&apos;end&apos;，0}</span></li>
</ul>
</dd>
<dt><span class="yiyi-st" id="yiyi-21">返回：</span></dt>
<dd><span class="yiyi-st" id="yiyi-22">现在的值</span></dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-23">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-24"><strong>rate</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-25">利率（每期）</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-26"><strong> NPER  T0&gt;：array_like</strong></span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-27">复合周期数</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-28"><strong>pmt</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-29">付款</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-30"><strong>fv</strong>：array_like，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-31">未来价值</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-32"><strong>时</strong>：{{&apos;begin&apos;，1}，{&apos;end&apos;，0}}，{string，int}</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-33">付款到期时（“开始”（1）或“结束”（0））</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-34">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-35"><strong>out</strong>：ndarray，float</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-36">一系列付款或投资的现值。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric"><span class="yiyi-st" id="yiyi-37">笔记</span></p>
<p><span class="yiyi-st" id="yiyi-38">通过求解以下等式计算当前值：</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">fv</span> <span class="o">+</span>
<span class="n">pv</span><span class="o">*</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">rate</span><span class="p">)</span><span class="o">**</span><span class="n">nper</span> <span class="o">+</span>
<span class="n">pmt</span><span class="o">*</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">rate</span><span class="o">*</span><span class="n">when</span><span class="p">)</span><span class="o">/</span><span class="n">rate</span><span class="o">*</span><span class="p">((</span><span class="mi">1</span> <span class="o">+</span> <span class="n">rate</span><span class="p">)</span><span class="o">**</span><span class="n">nper</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">=</span> <span class="mi">0</span>
</pre></div>
</div>
<p><span class="yiyi-st" id="yiyi-39">或<code class="docutils literal"><span class="pre">费率</span> <span class="pre">=</span> <span class="pre">0</span></code>：</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">fv</span> <span class="o">+</span> <span class="n">pv</span> <span class="o">+</span> <span class="n">pmt</span> <span class="o">*</span> <span class="n">nper</span> <span class="o">=</span> <span class="mi">0</span>
</pre></div>
</div>
<p><span class="yiyi-st" id="yiyi-40"><a class="reference internal" href="#numpy.pv" title="numpy.pv"><code class="xref py py-obj docutils literal"><span class="pre">pv</span></code></a>，然后返回。</span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-41">参考文献</span></p>
<table class="docutils citation" frame="void" id="wrw" rules="none">
<colgroup><col class="label"><col></colgroup>
<tbody valign="top">
<tr><td class="label"><span class="yiyi-st" id="yiyi-42"><a class="fn-backref" href="#id1">[WRW]</a></span></td><td><span class="yiyi-st" id="yiyi-43">Wheeler，D.A.，E.Rathke和R.Weir（Eds。）</span><span class="yiyi-st" id="yiyi-44">（2009年5月）。</span><span class="yiyi-st" id="yiyi-45">Office应用程序的打开文档格式（OpenDocument）v1.2，第2部分：重新计算公式（OpenFormula）格式 - 注释版本，预稿12。</span><span class="yiyi-st" id="yiyi-46">促进结构性信息标准组织（OASIS）。</span><span class="yiyi-st" id="yiyi-47">Billerica，MA，USA。</span><span class="yiyi-st" id="yiyi-48">[ODT文件]。</span><span class="yiyi-st" id="yiyi-49">可用：<a class="reference external" href="http://www.oasis-open.org/committees/documents.php?wg_abbrev=office-formula">http://www.oasis-open.org/committees/documents.php?wg_abbrev=office-formula</a> OpenDocument-formula-20090508.odt</span></td></tr>
</tbody>
</table>
<p class="rubric"><span class="yiyi-st" id="yiyi-50">例子</span></p>
<p><span class="yiyi-st" id="yiyi-51">一个投资的现值（例如，初始投资）需要在每个月节省100美元的10年后总共需要15692.93美元？</span><span class="yiyi-st" id="yiyi-52">假设利率为每月5％（每年）复利。</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">pv</span><span class="p">(</span><span class="mf">0.05</span><span class="o">/</span><span class="mi">12</span><span class="p">,</span> <span class="mi">10</span><span class="o">*</span><span class="mi">12</span><span class="p">,</span> <span class="o">-</span><span class="mi">100</span><span class="p">,</span> <span class="mf">15692.93</span><span class="p">)</span>
<span class="go">-100.00067131625819</span>
</pre></div>
</div>
<p><span class="yiyi-st" id="yiyi-53">按照惯例，负号表示现金流出（即，今天不可用的钱）。</span><span class="yiyi-st" id="yiyi-54">因此，在10年内最终可以节省15,692.93美元，每月节省100美元，年利率为5％，初始存款也应该是100美元。</span></p>
<p><span class="yiyi-st" id="yiyi-55">如果任何输入是array_like，则<code class="docutils literal"><span class="pre">pv</span></code>返回相等形状的数组。</span><span class="yiyi-st" id="yiyi-56">让我们比较上面例子中的不同利率：</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">((</span><span class="mf">0.05</span><span class="p">,</span> <span class="mf">0.04</span><span class="p">,</span> <span class="mf">0.03</span><span class="p">))</span><span class="o">/</span><span class="mi">12</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">pv</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="mi">10</span><span class="o">*</span><span class="mi">12</span><span class="p">,</span> <span class="o">-</span><span class="mi">100</span><span class="p">,</span> <span class="mf">15692.93</span><span class="p">)</span>
<span class="go">array([ -100.00067132,  -649.26771385, -1273.78633713])</span>
</pre></div>
</div>
<p><span class="yiyi-st" id="yiyi-57">因此，在每月100美元“储蓄计划”相同的$ 15692.93下，年利率为4％和3％，需要初始投资分别为649.27美元和1273.79美元。</span></p>
</dd></dl>
